const common = require('./webpack.common')
const webpack = require('webpack')
const { merge } = require('webpack-merge')

module.exports = merge(common, {
  target: 'web',
  mode: 'development',

  devServer: {
    contentBase: './public',
    open: true, // 自动打开浏览器
    hot: true, // 开启热更新
    host: 'localhost',
    port: 8081
  },

  // devtool: 'cheap-module-eval-source-map',
  devtool: 'eval-cheap-module-source-map',

  plugins: [
    new webpack.HotModuleReplacementPlugin()
  ]
})